<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div  id="11">dsd</div>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <div>ee</div>
    <script>
        function getScrollOffsets(w) {
            // Use the specified window or the current window if no argument
            w = w || window;
            console.log(w);
            // This works for all browsers except IE versions 8 and before
            if (w.pageXOffset != null) return { x: w.pageXOffset, y: w.pageYOffset };

            // For IE (or any browser) in Standards mode
            var d = w.document;
            console.log(d);
            console.log(m);

            if (document.compatMode == "CSS1Compat")
                return { x: d.documentElement.scrollLeft, y: d.documentElement.scrollTop };
            
            // For browsers in Quirks mode
            return { x: d.body.scrollLeft, y: d.body.scrollTop };
        }
        // var w = document.getElementById("11") 
        var a = getScrollOffsets();
        console.log(a)

    </script>
</body>


</html>